home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / FAQ.SWG / 0039_SEC16-BORLAND.pas < prev    next >
Pascal/Delphi Source File  |  1995-02-28  |  5KB  |  112 lines

  1.                           SECTION 16 - OWL/BWCC
  2.                                     
  3.                                     
  4. GENERAL INFORMATION
  5.  
  6. This document contains information that is most often provided to
  7. user of Section 16 - OWL/BWCC.  There is a listing of common
  8. Technical Information Documents that can be downloaded from the
  9. libraries.  There is also a description of the five questions
  10. most frequently asked in Section 16 - OWL/BWCC and their answers.
  11.  
  12.  
  13. TECHNICAL INFORMATION DOCUMENTS
  14.  
  15. TI1203   Using Validators in OWL Applications
  16. TI1262   Installation notes regarding Turbo Debugger for Windows
  17. TI1171   Borland problem report form
  18. TI607    Description and illustration of printing in Windows
  19. TI992    Demonstration of collections and listboxes in Windows
  20.  
  21.  
  22.  
  23. FREQUENTLY ASKED QUESTIONS
  24.  
  25. Q:   "Why do I get 'Application Error -1' when my dialog tries to
  26.      execute?"
  27. A:   This is basically a "Failure to create window" error.
  28.      Most often it is caused by one of two things:
  29.      1.  Failure to include "BWCC" in your USES clause.  If you
  30.          designed a dialog in Resource Workshop using the Borland
  31.          "look and feel", you need to include "BWCC" in your USES
  32.          clause.
  33.      2.  Incorrect dialog identifier passed to dialog's Init
  34.          method.  Make sure the identifier you are passing to the
  35.          dialog's Init method is the same one you are using in
  36.          Resource Workshop.
  37.  
  38. Q:   "How can I obtain the latest copy of BWCC.DLL?"
  39. A:   Download BWCC.ZIP from library 2.
  40.  
  41. Q:   "What causes the 'Data Segment too large' compiler error?
  42.      How do I get rid of it?"
  43. A:   This error occurs when your application has more than 64K of
  44.      information that it is trying to put into your its data
  45.      segment.  Note that you only have one 64K data segment to
  46.      work with, so you should manage this memory judiciously. 
  47.      The following data is kept in an Object Windows 
  48.      application's data segment:
  49.           * All global variables
  50.           * All typed constants
  51.           * Stack
  52.           * Local Heap (used internally by Windows)
  53.           * Virtual Method Table
  54.  
  55.      To avoid this error, you should take the following steps:
  56.           * Avoid large global variables.  Try instead declaring
  57.             larger variables on the heap using New() or GetMem(),
  58.             and keeping a pointer to that variable globally.
  59.           * Avoid frequent use of string literals and variables
  60.             in your application.  Instead, keep your strings in a
  61.             resource and use the LoadString API function to load
  62.             them into memory.
  63.           * Keep your stack down to a reasonable size.  8K is
  64.             usually a good amount for most applications.
  65.           * Avoid making functions in your objects Virtual unless
  66.             they have to be; this will reduce the size of the
  67.             Virtual Method Table.
  68.  
  69.  
  70. Q:   "How can I enable or disable a particular control in a
  71.      dialog box?
  72. A:   Use the EnableWindow(Wnd: Hwnd, Enable: Bool) API function. 
  73.      It takes two parameters, the handle to the window (remember
  74.      a control is a window) to be enabled/disabled and a boolean
  75.      value - True for enable and False for disable.
  76.  
  77. Q:   "How do I obtain the handle or ID of a control?" 
  78. A:   If you have a pointer to a control object, OWL will give you
  79.      the window handle automatically through the HWindow field;  
  80.      PointerToMyControl^.HWindow is the window handle.
  81.  
  82.      If you know the handle of a control, you can obtain the ID
  83.      by calling the GetDlgCtrlID() API function:
  84.         ControlID := GetDlgCtrlID(ControlHandle);
  85.  
  86.      If you don't have a pointer to your control, but know the ID
  87.      of a control, you can obtain the handle by calling the
  88.      GetDlgItem() API function:
  89.  
  90.         ControlHandle := GetDlgItem(DialogHandle, ControlID);
  91.    
  92. Q:   "How can I put Object Windows objects in a DLL?"
  93. A:   OWL was not designed to be used in a DLL.  Some users have
  94.      managed to get this to work in some cases, but it is not a
  95.      practice that Borland recommends.  For info on launching 
  96.      windows and dialogs from a DLL without OWL, download
  97.      APIDLL.PAS from library 2.
  98.  
  99. Q:   "Can a TFileWindow object edit files larger than 64K?"
  100. A:   No.  A TFileWindow is really just a multi-line edit control
  101.      that takes up the whole client area.  An edit control's
  102.      buffer is allocated from the local heap, and therefore is 
  103.      usually much smaller than 32K.  If you would like to have 
  104.      more buffer space, download GLBEDT.ZIP from library 8 - this 
  105.      file provides you with a greater buffer for the TEdit and
  106.      TFileWindow objects.
  107.  
  108. Q:   "How do I apply to become a beta tester for a future Borland
  109.      Pascal product?"
  110. A:   Download SURVEY.ZIP from library 2.
  111.     
  112.